use ${dat}\HSV_repdata.dta, clear

replace year=year+1
gen personid=id68*1000+hpersno 

gen hsv_s=1

keep id68 personid hpersno year hsv_s

save ${dat}\hsv_samp.dta,replace

use ${dat}panel_99_15.dta, clear

merge 1:1 personid year using ${dat}\hsv_samp.dta, keep(3) keepusing(hsv_s)

save ${dat}\hsv_samp.dta ,replace



